version: '2.4'

services:
  app:
    image: ${APP_TEST_IMAGE}
    environment:
      - DJANGO_ENV=test
    command: [ "pytest",  "-n", "auto", "--cov-report=html:coverage_html" ]
    depends_on:
      postgres:
        condition: service_healthy

  postgres:
    image: postgres:12.1
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 5
